﻿<!DOCTYPE html>
<html ng-app="app">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width" />
    <title>@ViewBag.Title</title>
    @Styles.Render("~/Assets/Bootstrap/css/bootstrap.css")
    @Styles.Render("~/styles")
</head>
<body>

    @RenderBody()


    <br />
    <br />
    <div class="row">
        <div class="col-md-10 col-md-offset-1">
            <footer>
                <p>Learn more about <b><a href="http://jsnet.codeplex.com/ " target="_blank">Diphap.JsNetBridge.Mvc</a></b></p>
                <p>Learn more about <b><a target="_blank" href="https://visualstudiogallery.msdn.microsoft.com/48d928e3-9b5c-4faf-b46f-d6baa7d9886c">ng.Net</a></b></p>
            </footer>
        </div>
    </div>

    @Scripts.Render("~/ng")
    @Scripts.Render("~/app")
    @Scripts.Render("~/jquery")
    @Scripts.Render("~/bootstrap")

    @* JsNetBridge: it will generate the url. *@
    @Scripts.Render("~/bundles/JsNetBridge")
    <script>

		@* retrieves the route templates (ex: "{controller}/{action}/{id}" or api/{controller}/{id} *@
        $dp.$JsNet.$Helpers.$Api.$Routes.$selectedRoute.$RouteTemplate = '@(System.Web.Routing.RouteTable.Routes["DefaultApi"] == null ? "" : (System.Web.Routing.RouteTable.Routes["DefaultApi"] as System.Web.Routing.Route).Url)';
        $dp.$JsNet.$Helpers.$Mvc.$Routes.$selectedRoute.$RouteTemplate = '@(System.Web.Routing.RouteTable.Routes["Default"] == null ? "" : (System.Web.Routing.RouteTable.Routes["Default"] as System.Web.Routing.Route).Url)';

        @* generates the url of action method. *@
        @(new MvcHtmlString(WebApp.WebApiApplication.AspMvcInfo.UrlInfo.ToJS_SetUrl(new Diphap.JsNetBridge.Mvc.Proxy.UrlManager(this.Url.Action, this.Url.RouteUrl),"DefaultApi")))

    </script>
    @* JsNetBridge: example of use. Read the prerequisites in the script 'Diphap.JsNetBridge.Example.js' *@
    <script src="~/Scripts/Diphap.JsNetBridge/Diphap.JsNetBridge.Example.js" ></script> 

    @Scripts.Render("~/misc")
</body>
</html>
